import React, { PureComponent } from 'react';
import _ from 'lodash';
import { TableC } from '../../../../../components';

export default class TradeStatistics extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() {}

  render() {
    const { data = {}, loading } = this.props;
    const { columns = [], dataSource = [] } = data;

    const newColums = columns.map((x) => {
      if (x.key === 'AMOUNT') {
        return {
          ...x,
          type: 'money',
        };
      } else if (x.key === 'TRADEDATE') {
        return {
          ...x,
          type: 'date',
        };
      } else {
        return x;
      }
    });

    return (
      // JSON.stringify(data) == '{}' ? (
      //     // <div style={{ height: 200 }}>
      //         <NoQueryC />
      //     //  </div>
      // ) :

      <TableC columns={newColums} dataSource={dataSource} hidePage={true} rowKey='KEY' loading={loading} />
    );
  }
}
